package flst.ipiweb.common;

import java.util.Random;
import java.util.UUID;

public class CommandLine {

	private int id;
	private Article article;
	private int quantity;
	private float totalLigne;

	public CommandLine() {
		Random r = new Random();
		this.setId(r.nextInt(Integer.MAX_VALUE));
	}

	public CommandLine(int id) {
		this.setId(id);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public float getTotalPrice() {
		if (this.getArticle() != null && this.getQuantity() > 0) {
			return this.getArticle().getPrice() * this.getQuantity();
		} else {
			return 0;

		}
	}

	public float getTotalLigne() {
		return totalLigne;
	}

	public void setTotalLigne(float totalLigne) {
		this.totalLigne = totalLigne;
	}

}
